
package at.fhj.itm.metadata.impl.postgres;

import at.fhj.itm.metadata.CheckConstraint;
import at.fhj.itm.metadata.Constraint;
import static at.fhj.itm.metadata.MetadataUtil.copyMetadataList;
import java.util.List;

/**
 *
 * @author Seuchter
 */
public class PostgresCheckConstraint extends PostgresConstraint  implements CheckConstraint{

    private String checkExpression;


    public PostgresCheckConstraint(long oid, String name, List<PostgresColumn> columns, String checkExpression)
    {
        super(oid, name, columns,Constraint.CONSTRAINT_TYPE_CHECK);
        this.checkExpression = checkExpression;
       
    }
    public PostgresCheckConstraint copy(){
        
        return new PostgresCheckConstraint(-1, getName(),copyMetadataList(getConstraintColumns()),
                getCheckExpression());
    }
    public String getCheckExpression()
    {
        return checkExpression;
    }






}
